﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Hotel.WCF.Contracts;
using Hotel.WCF.ServiceSms;

namespace Hotel.WCF.ImpServices
{
    public partial class GestionHotel : IHotel
    {
        public StatutSMS SendSMS(string destinataire, string message)
        {
            ServiceSmsProSoapClient client = new ServiceSmsProSoapClient();
            StatutSMS statut ;

            try
            {
                statut = client.SendSmsToPeer("766752275", "malaw@sms", "HOTEL", destinataire, message);

            }
            catch
            {
                statut = StatutSMS.NetworkFail;
            }
            finally
            {
                if (client.State == System.ServiceModel.CommunicationState.Opened)
                    client.Close();

            }

            return statut;
        }

    }
}

 